
#ifdef  LC786XXX

#define	LC786XXX_ADDR	0x2C
#define	LC786XXX_WRITE	0x00
#define	LC786XXX_READ	0x02

typedef enum{
	LC786X_CURRENT,
	LC786X_CDDA,
	LC786X_CDROM,
	LC786X_USB,
	LC786X_SD,
	LC786X_NEW_MEDIA,
	LC786X_IPOD
}LC786X_MEDIA_ID;

typedef enum{
	LC786X_MS_RESET_START,					// 0x00
	LC786X_MS_STOP_NO_TOC,					// 0x01
	LC786X_MS_STOP,							// 0x02
	LC786X_MS_TOC_READ,						// 0x03
	LC786X_MS_CONTENTS_ANALYSIS,			// 0x04
	LC786X_MS_SEARCH,						// 0x05
	LC786X_MS_PLAYBACK,						// 0x06
	LC786X_MS_PAUSE,						// 0x07
	LC786X_MS_FASTFORWARD,					// 0x08
	LC786X_MS_FASTBACK,						// 0x09
	LC786X_MS_PAUSE_AT_HEADER_OF_TRACK,		// 0x0A
	LC786X_MS_PAUSE_AT_END_OF_TRACK,		// 0x0B
	LC786X_MS_PAUSE_AT_HEADER_OF_FOLDER,	// 0x0C
	LC786X_MS_PAUSE_AT_END_OF_FOLDER,		// 0x0D
	LC786X_MS_PAUSE_AT_HEADER_OF_DISC,		// 0x0E
	LC786X_MS_PAUSE_AT_END_OF_DISC,			// 0x0F
	LC786X_MS_PAUSE_AT_STARTUP = 0x11,
	LC786X_MS_DISK_BRAKE,
	LC786X_MS_UPDATE_MODE_OPERATION = 0x1D,
	LC786X_MS_CD_DA_MEDIA_OPERATION,
	LC786X_MS_CD_ROM_OPERATION,
	LC786X_MS_SEARCH_PLAYLIST = 0x25,
	LC786X_MS_PLAYBACK_PLAYLIST,
	LC786X_MS_PAUSE_PLAYLIST,
	LC786X_MS_FASTFORWARD_PLAYLIST,
	LC786X_MS_FASTBACK_PLAYLIST,

	LC786X_MS_OPERATION_NOT_BOOTED_YET_USB = 0x30,	// 48
	LC786X_MS_DEVICE_SYSTEM_STANDBY,				// 0x31
	LC786X_MS_DEVICE_SUSPEND,						// 0x32
	LC786X_MS_DEVICE_DISCONNECT,					// 0x33
	LC786X_MS_DEVICE_CONNECT,						// 0x34
	LC786X_MS_HUB_CONNECT,							// 0x35
	LC786X_MS_HUB_CONNECT_UNKNOWN,					// 0x36
	LC786X_MS_DEVICE_UNKNOWN,						// 0x37
	LC786X_MS_IPOD_CONNECT_UNKNOWN,					// 0x38
	LC786X_MS_IPOD_CONNECT,							// 0x39
	LC786X_MS_MASS_STORAGE_CONNECT,					// 0x3A
	LC786X_MS_MASS_STORAGE_CHECK,
	LC786X_MS_MASS_STORAGE_ACTIVE = 0x3D,
	LC786X_MS_IPOD_ACTIVE,
	LC786X_MS_MEDIA_DISCONNECT,

	LC786X_MS_UPDATE_PREPARATION_ONGOING = 0x70,
	LC786X_MS_WAITING_UPFATE,
	LC786X_MS_EXECUTION_START,
	LC786X_MS_VBUS_CUT_REQUEST,
	LC786X_MS_EXECUTION_ONGOING,
	LC786X_MS_FINISH_ERROR = 0x76,
	LC786X_MS_FINISH_NORMAL
}LC786X_MEDIA_STATUS;

LC786X_MEDIA_STATUS LC786XXX_GetMediaStatus(UI_FUNCTION ucFunc);

typedef enum{
	LC786X_EC_NoError,
// E1 Error
	LC786X_EC_FlashError = 0x0F,
	LC786X_EC_MirrorDetect = 0x11,
	LC786X_EC_FocusError,
	LC786X_EC_FileAnalyzeError,
	LC786X_EC_NoFile,
	LC786X_EC_PVD_SVD_ReadError,
	LC786X_EC_No_PVD_SVD,
	LC786X_EC_TrackingError = 0x19,

	LC786X_EC_AutoAdjustError = 0x20,
	LC786X_EC_SearchError,
	LC786X_EC_TOC_ReadError,
	LC786X_EC_SubCodeReadError = 0x24,

	LC786X_EC_PUIN_SW_ON_Error = 0x31,
	LC786X_EC_DSP_CommunicationError,
	LC786X_EC_PUIN_SW_OFF_Error,
	LC786X_EC_AudioDecoderInitializeError,
	LC786X_EC_SDRAM_Error,	
	
	LC786X_EC_DecodeError = 0x41,
	LC786X_EC_MP3_LayerError,
	LC786X_EC_MP3_FileFrameReadError = 0x44,
	LC786X_EC_MP3_FileFrameError,
	LC786X_EC_MP3_FileSizeError,
	LC786X_EC_WMA_FileSizeError,
	LC786X_EC_WMA_DecodeError,
	LC786X_EC_AAC_FileSizeError,
	LC786X_EC_AAC_DecodeError,
	LC786X_EC_WMA_CopyrightedFile = 0x51,
	LC786X_EC_AAC_CopyrightedFile = 0x52,
	
	LC786X_EC_USB_ErrUnexpected = 0x60,
	LC786X_EC_USB_ErrDriver = 0x61,
	LC786X_EC_USB_EnumerateError = 0x62,
	LC786X_EC_USB_ErrResponse = 0x63,
	
	LC786X_EC_FileSysInitializeError = 0x68,
	LC786X_EC_FileSysUnknown,
	LC786X_EC_FileSysAnalyze,
	LC786X_EC_FileOpenError,
	LC786X_EC_FileReadError
}LC786X_ERROR_CODE;

LC786X_ERROR_CODE LC786XXX_GetErrorCode(LC786X_MEDIA_ID ucMediaID);

typedef  enum{
	LC786X_DS_NONE,
	LC786X_DS_READING,
	LC786X_DS_COMPLETE
}LC786X_DISC_STATUS;

typedef  enum{
	LC786X_DISC_NONE,
	LC786X_DISC_NOTSUPPORT,
	LC786X_DISC_CDDA,
	LC786X_DISC_CDROM,
	LC786X_DISC_MIXED,
	LC786X_DISC_VIDEO,
	LC786X_DISC_VIDEO_CDDA,
	LC786X_DISC_SVIDEO,
}LC786X_DISC_TYPE;

typedef  enum{
	LC786X_TEXT_FILE_NAME,
	LC786X_TEXT_FOLDER_NAME,
	LC786X_TEXT_TITLE,
	LC786X_TEXT_ARTIST,
	LC786X_TEXT_ALBUM,
	LC786X_TEXT_ARTIST_ALBUM,
	LC786X_TEXT_YEAR,
	LC786X_TEXT_COMMENT,
	LC786X_TEXT_GENRE
}LC786X_TEXT_ID;

#define	LC786XXX_INIT_IDLE			0x00
#define	LC786XXX_INIT_START			0x10
#define	LC786XXX_INIT_RESET			0x20
#define	LC786XXX_INIT_CK_BUSY		0x30
#define	LC786XXX_INIT_CK_BUSY_DUMMY		0x31
#define	LC786XXX_INIT_CK_RESET		0x40
#define	LC786XXX_INIT_CK_DEVICE		0x50
#define	LC786XXX_INIT_SEQ_INIT		0x60
#define	LC786XXX_INIT_READ_STATUS	0x70
#define	LC786XXX_INIT_READ_RESULT	0x71
#define	LC786XXX_INIT_SERVO_PARAM_B1		0x80
#define	LC786XXX_INIT_SERVO_PARAM_B2		0x81
#define	LC786XXX_INIT_SERVO_REG		0x82
#define	LC786XXX_INIT_SERVO_RAM		0x83
#define	LC786XXX_INIT_END			0x90
#ifdef  LC786XXX_AUDIO
#define	LC786XXX_INIT_AUDIO			0xA0
#endif
#define	LC786XXX_INIT_USB_DETECT	0xC0

#define	LC786XXX_RSPI_IDLE			0x00
#define	LC786XXX_RSPI_START			0x10
#define	LC786XXX_RSPI_SET			0x11
#define	LC786XXX_RSPI_WAIT			0x20
#define	LC786XXX_RSPI_END			0x30
#define	LC786XXX_RSPI_END_ERROR		0x40

#define	LC786XXX_SPI_S_IDLE			0x00
#define	LC786XXX_SPI_S_START		0x10
#define	LC786XXX_SPI_S_WAIT			0x20
#define	LC786XXX_SPI_S_END			0x30
#define	LC786XXX_SPI_S_END_ERROR	0x40

#define	LC786XXX_SPI_READ	0x01
#define	LC786XXX_SPI_WRITE	0x02
#define	LC786XXX_SPI_IDLE	0x00


typedef enum{
	LC786X_FORMAT_UNKNOWN,
	LC786X_FORMAT_CDDA,
	LC786X_FORMAT_MPEG1_LAYER1,
	LC786X_FORMAT_MPEG1_LAYER2,
	LC786X_FORMAT_MPEG1_LAYER3,
	LC786X_FORMAT_MPEG2_LAYER1,
	LC786X_FORMAT_MPEG2_LAYER2,
	LC786X_FORMAT_MPEG2_LAYER3,
	LC786X_FORMAT_MPEG25_LAYER1,
	LC786X_FORMAT_MPEG25_LAYER2,
	LC786X_FORMAT_MPEG25_LAYER3,
	LC786X_FORMAT_WMA,
	LC786X_FORMAT_ACC
}LC786X_FORMAT;


#define	LC786X_RPT_ALL	0x80
#define	LC786X_RPT_FLD	0xC0
#define	LC786X_RPT_FILE	0xA0

#define	LC786XXX_SPI_SEND_BUFFER_SIZE	512
#define	LC786XXX_SPI_RECEIVE_BUFFER_SIZE	256

#define	LC786XXX_PROCESS_IDLE			0x00
#define	LC786XXX_PROCESS_CHECK_MOUNTED	0x01
#define	LC786XXX_PROCESS_WAIT_READING	0x03
#define	LC786XXX_PROCESS_GET_TOTALFILE	0x04
#define	LC786XXX_PROCESS_GET_MEDIA_INFO	0x05
#define	LC786XXX_PROCESS_PLAY_REQUEST	0x06
#define	LC786XXX_PROCESS_CHECK_PLAY		0x07
//#define	LC786XXX_PROCESS_PLAY_CONFIRM	0x08
#define	LC786XXX_PROCESS_MEDIA_CHANGE	0x30
#define	LC786XXX_PROCESS_EJECT			0x40
#define	LC786XXX_PROCESS_EJECT_CLEAR_INFO		0x41
#define	LC786XXX_PROCESS_EJECT_WAIT_STOP		0x42
#define	LC786XXX_PROCESS_NORMAL			0x80


unsigned char DRV_LC786XXX_GetCDProcess(void);
void LC786XXX_ChangeToCD(void);
void LC786XXX_ChangeToUSB(void);


#endif



